home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / LITTLE / P3SRC.ZIP / ATARI / VLBUFFER.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-07  |  3.8 KB  |  140 lines

  1. /****************************************************************************
  2. *                   vlbuffer.h
  3. *
  4. *  This module contains all defines, typedefs, and prototypes for VLBUFFER.C.
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24.  
  25. #ifndef VLBUFFER_H
  26. #define VLBUFFER_H
  27.  
  28. #include "bbox.h"
  29.  
  30.  
  31.  
  32. /*****************************************************************************
  33. * Global preprocessor defines
  34. ******************************************************************************/
  35.  
  36. /* flag to mark a node as pruned */
  37.  
  38. #define PRUNE_CHECK 128
  39. #define PRUNE_TEMPORARY 128
  40.  
  41.  
  42.  
  43. /* Define minimum and maximum values for buffer coordinates. */
  44.  
  45. #define MIN_BUFFER_ENTRY -32000
  46. #define MAX_BUFFER_ENTRY  32000
  47.  
  48.  
  49.  
  50. /* Define maximum number of clippoints. */
  51.  
  52. #define MAX_CLIP_POINTS 20
  53.  
  54.  
  55.  
  56. /* Define all six coordinate axes. */
  57.  
  58. #define XaxisP 0
  59. #define XaxisM 1
  60. #define YaxisP 2
  61. #define YaxisM 3
  62. #define ZaxisP 4
  63. #define ZaxisM 5
  64.  
  65.  
  66.  
  67. /*****************************************************************************
  68. * Global typedefs
  69. ******************************************************************************/
  70.  
  71. typedef struct Project_Struct PROJECT;
  72.  
  73. typedef struct Project_Tree_Node_Struct PROJECT_TREE_NODE;
  74. typedef struct Project_Tree_Leaf_Struct PROJECT_TREE_LEAF;
  75. typedef struct Project_Queue_Struct PROJECT_QUEUE;
  76.  
  77. struct Project_Struct
  78. {
  79.   int x1, y1, x2, y2;
  80. };
  81.  
  82. /*
  83.  * The following structure represent the bounding box hierarchy in 2d space.
  84.  * Because is_leaf, Object and Project are the first elements in both
  85.  * structures they can be accessed without knowing at which structure
  86.  * a pointer is pointing.
  87.  */
  88.  
  89. struct Project_Tree_Node_Struct
  90. {
  91.   unsigned short is_leaf;
  92.   BBOX_TREE *Node;
  93.   PROJECT Project;
  94.   unsigned short Entries;
  95.   PROJECT_TREE_NODE **Entry;
  96. };
  97.  
  98. struct Project_Tree_Leaf_Struct
  99. {
  100.   unsigned short is_leaf;
  101.   BBOX_TREE *Node;
  102.   PROJECT Project;
  103. };
  104.  
  105. struct Project_Queue_Struct
  106. {
  107.   unsigned QSize;
  108.   unsigned Max_QSize;
  109.   PROJECT_TREE_NODE **Queue;
  110. };
  111.  
  112.  
  113.  
  114.  
  115. /*****************************************************************************
  116. * Global variables
  117. ******************************************************************************/
  118.  
  119. extern PROJECT_QUEUE *Node_Queue;
  120. extern PRIORITY_QUEUE *VLBuffer_Queue;
  121.  
  122.  
  123.  
  124. /*****************************************************************************
  125. * Global functions
  126. ******************************************************************************/
  127.  
  128. void Clip_Polygon PARAMS((VECTOR *Points, int *PointCnt, VECTOR VX1, VECTOR VX2,
  129.   VECTOR VY1, VECTOR VY2, DBL DX1, DBL DX2, DBL DY1, DBL DY2));
  130.  
  131. void Initialize_VLBuffer_Code PARAMS((void));
  132. void Reinitialize_VLBuffer_Code PARAMS((void));
  133. void Deinitialize_VLBuffer_Code PARAMS((void));
  134.  
  135. void Destroy_Project_Tree PARAMS((PROJECT_TREE_NODE *Node));
  136.  
  137.  
  138.  
  139. #endif
  140.